package chapter09

/**
  * @Copyright: Shanghai Definesys Company.All rights reserved.
  * @Description:
  * @author: chuhaitao
  * @since: 2019/1/10 22:17
  * @history:
  *          1.2019/1/10 created by chuhaitao
  */
object SingleTon {

  def main(args: Array[String]): Unit = {
    //单列模式
    var f = Fog.singleTon

  }
}


class Fog private() {

}
object Fog {
  var singleTon: Fog = _
  def getGog: Fog = {
    if (singleTon == null) {
      new Fog
    } else {
      singleTon
    }
  }
}
